package gang.org.springframework.framework.io;

import gang.org.springframework.framework.util.GangClassUtils;

import java.io.InputStream;

public class GangClassPathResource extends GangAbstractFileResolvingResource{

    private final String path;

    private ClassLoader classLoader;

    //TODO
    @Override
    public InputStream getInputStream() {
        InputStream is;

        is = this.classLoader.getResourceAsStream(this.path);
        return is;
    }

    public GangClassPathResource(String path, ClassLoader classLoader){
        //TODO
        this.path = path;
        this.classLoader = classLoader != null? classLoader: GangClassUtils.getDefaultClassLoader();
    }


    @Override
    public String getDescription() {
        return null;
    }
}
